<?php
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//
// DLMan by Shedd Technologies International		  				//
// http://www.dlman.com | info@dlman.com							//
// Copyright 2003 by STI, All rights reserved.						//
// ---------------------------------------------------------------- //
// Usage of this software is governed by the terms of GPL. 	    	//
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//

require("cvar.php");
//Stage 4: Write the config info to the database
if($stage=="4"){
	//load database connection information
	require($file);
	//mysql connection should have been created

	//Make database changes
		//$base_path=addslashes($base_path);
		$sqlarray=array(
			"UPDATE ".$mysql['pre']."settings"." SET title='".addslashes($title1)."';",
			"UPDATE ".$config->dt['settings']." SET script_url='".$scripturla."';",
			"UPDATE ".$mysql['pre']."settings"." SET forum_url='".$forum_url1."';",
			"UPDATE ".$mysql['pre']."settings"." SET forum_title='".addslashes($forum_title1)."';",
			"UPDATE ".$mysql['pre']."settings"." SET forum_register='".$forum_register1."';",
			"UPDATE ".$mysql['pre']."settings"." SET max_file_size='".$max_file_size1."';",
			"UPDATE ".$mysql['pre']."settings"." SET sales_address ='".$sales_address1."';",
			"UPDATE ".$mysql['pre']."settings"." SET validation_go='".addslashes($validation_go1)."';",
			"UPDATE ".$mysql['pre']."settings"." SET validation_delay='".addslashes($validation_delay1)."';",
			"UPDATE ".$mysql['pre']."settings"." SET mail_passchg='".addslashes($mail_passchg1)."';",
			"UPDATE ".$mysql['pre']."settings"." SET mail_lostpass='".addslashes($mail_lostpass1)."';",
		);
		//Process Query
		
		$err=false;
		foreach($sqlarray as $sql){
			$result="";
			if(!$result=mysql_query($sql)){
				print "<p>Error in updating data!<br>";
				print mysql_error();
				print '<br><a href="setup_4.php?stage=3&comsetup='.$comsetup.'">Click Here to try again</a><br><br>';
				print "$sql</p>";
				$err=true;
			}//end error
		}//end loop
		if($err!=true){
			?><br><br><div align="center">
			<STRONG><FONT face=Verdana size=2>All settings have been updated.</FONT></STRONG>
			<?php
				print '<br><br><a href="setup_6.php';
				print '?stage=5&comsetup='.$comsetup.'">Click Here to Continue</a></div><br><br>';
		}//end no error
		else{
			print "Error in updating information.  Please try again.";
		}
}//end stage 4
?>
